package com.tencent.web.controller;

import com.github.pagehelper.PageInfo;
import com.tencent.entity.Member;
import com.tencent.entity.Pagination;
import com.tencent.entity.Result;
import com.tencent.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/member1")
public class MemberController {

    @Autowired
    private MemberService memberService;

    @GetMapping
    public Result findAll(Pagination pagination){
        PageInfo<Member> byName = memberService.findByName(pagination);
//        Result result = new Result(true, "ok", byName);
        return Result.success(byName);
    }
}
